<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jstl/core"
                template="/template.xhtml">

    <ui:define name="conteudo">
        <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
        </h:panelGroup>
            <h4>#{msg['novo_funcionario']}</h4>
                <h:panelGrid columns="2">
                    <h:outputText value="CPF:"/>
                    <h:inputText id="cpf" value="#{funcionario.funcionario.cpf}" title="Cpf" required="true" requiredMessage="The cpf field is required." />
                    <h:outputText value="RG:"/>
                    <h:inputText id="rg" value="#{funcionario.funcionario.rg}" title="Rg" required="true" requiredMessage="The rg field is required." />
                    <h:outputText value="CTPS:"/>
                    <h:inputText id="ctps" value="#{funcionario.funcionario.ctps}" title="Ctps" required="true" requiredMessage="The ctps field is required." />
                    <h:outputText value="#{msg['rua']}:"/>
                    <h:inputText id="endRua" value="#{funcionario.funcionario.endRua}" title="EndRua" />
                    <h:outputText value="#{msg['bairro']}:"/>
                    <h:inputText id="endBairro" value="#{funcionario.funcionario.endBairro}" title="EndBairro" />
                    <h:outputText value="#{msg['cidade']}"/>
                    <h:inputText id="endCidade" value="#{funcionario.funcionario.endCidade}" title="EndCidade" />
                    <h:outputText value="#{msg['cep']}:"/>
                    <h:inputText id="endCep" value="#{funcionario.funcionario.endCep}" title="EndCep" />
                    <h:outputText value="#{msg['uf']}"/>
                    <h:inputText id="endUf" value="#{funcionario.funcionario.endUf}" title="EndUf" />
                    <h:outputText value="#{msg['salario']}:"/>
                    <h:inputText id="salario" value="#{funcionario.funcionario.salario}" title="Salario" required="true" requiredMessage="The salario field is required." />
                    <h:outputText value="#{msg['nome']}:"/>
                    <h:inputText id="nome" value="#{funcionario.funcionario.nome}" title="Nome" required="true" requiredMessage="The nome field is required." />
                    <h:outputText value="#{msg['nome_cargo']}"/>

                    <h:selectOneMenu value="#{funcionario.funcionario.idCargo}"  >
                        <c:forEach items="#{cargo.listCargos}" var="item">
                            <f:selectItem itemValue="#{item.id}" itemLabel="#{item.cargo}"/>
                            <f:converter converterId ="converterCargos" />
                        </c:forEach>
                    </h:selectOneMenu>

                    <h:commandButton action="#{funcionario.edit}" value="#{msg['salvar']}"/>
                </h:panelGrid>

    </ui:define>

</ui:composition>